package com.amkai.aes.webservice.binary.objecthandler.testing;

import java.io.Serializable;

import com.amkai.aes.aescommon.service.binary.job.testing.TestJob;
import com.amkai.aes.webservice.binary.JobObjectHandler;
import com.amkai.aes.webservice.binary.objecthandler.ddm.BinaryDataCleaner;

public class TestJobHandler implements JobObjectHandler<TestJob, Serializable, String> {

	public String process(TestJob job, Serializable object) throws Exception {
		if (job.getTestKind().equals(TestJob.PARALLEL_SESSION) ||
			job.getTestKind().equals(TestJob.PARALLEL_SESSION_PERSON_ITEM)) {
			
			ParallelSessionTest pst = new ParallelSessionTest(job);
			pst.start();
		} else if(TestJob.BINARY_TEST.equals(job.getTestKind())) {
			BinaryDataCleaner bdc = new BinaryDataCleaner();
			bdc.cleanUpBinary();
		}
		return "OK";
	}

}
